﻿<Window x:Class="VideoMagic.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:effects="clr-namespace:VideoMagic.EffectsLibrary;assembly=VideoMagicEffectsLibrary"
        Title="MainWindow" ResizeMode="CanResizeWithGrip" SizeToContent="WidthAndHeight" WindowStartupLocation="CenterScreen"
        Loaded="Window_Loaded" Closed="Window_Closed">
    <StackPanel Orientation="Vertical">
        <StackPanel Orientation="Horizontal">
            <Button Content="Capture Background" Height="23" Name="captureBackgroundButton" Width="145" Click="captureBackgroundButton_Click" />
            <Button Content="Save Background" Height="23" Name="saveBackgroundButton" Width="118" Click="saveBackgroundButton_Click" />
            <Button Content="Load Background" Height="23" Name="loadBackgroundButton" Width="106" Click="loadBackgroundButton_Click" />
            <Button Content="Show 3D window" Height="23" Name="recordButton" Width="114" Click="recordButton_Click" Visibility="Collapsed" />
            <Button Content="Disappear" Height="23" Name="fadeButton" Width="75" Click="fadeButton_Click" />
            <Button Content="Full Screen" Height="23" Name="button1" Width="75" Click="button1_Click" />
            <Button Content="QR" Height="23" Name="QRButton" Width="75" Click="QRButton_Click" />
            <Slider x:Name="lowerSlider" Height="23"  Width="100" Maximum="1" Minimum="0" Value="0"/>
            <TextBox Text="{Binding Value, ElementName=lowerSlider}" />
            <Separator Height="5" Name="separator2" Width="2" />
            <Slider x:Name="upperSlider" Height="23"  Width="100" Maximum="1" Minimum="0" Value="1"/>
            <TextBox Text="{Binding Value, ElementName=upperSlider}" />
            <Separator Height="5" Name="separator1" Width="5" />
            <Label Content="Depth at Mouse Point" Height="28" Name="label1" />
            <TextBox Height="23" Name="mouseCoords" Width="120" />
        </StackPanel>
        <StackPanel Name="MainStackPanel" Orientation="Horizontal">
            <StackPanel Name="Column1" Orientation="Vertical" ToolTip="Feed from Kinect color and depth camera">
                <StackPanel>
                    <TextBox FontSize="18" Focusable="False" BorderThickness="0" Text="Depth Input" HorizontalAlignment="Center" Name="depthInputCaption" />
                    <Border BorderThickness="1" BorderBrush="Black" Margin="10 0 10 10" >
                        <Image Width="400" Height="300" Name="depthInputImage" Margin="0"/>
                    </Border>
                </StackPanel>
                <StackPanel >
                    <TextBox FontSize="18" Focusable="False" BorderThickness="0" Text="Color Input" HorizontalAlignment="Center" Name="colorInputCaption" />
                    <Border  BorderThickness="1" BorderBrush="Black" Margin="10 0 10 10" >
                        <Image Width="400" Height="300" Name="colorInputImage" Margin="0" MouseMove="colorInputImage_MouseMove">
                        </Image>
                    </Border>
                </StackPanel>
            </StackPanel>
            <StackPanel Visibility="Visible" Name="Column2" Orientation="Vertical" ToolTip="Output from depth data transformation">
                <StackPanel Name="DepthPanel" Visibility="Visible">
                    <TextBox FontSize="18" Focusable="False" BorderThickness="0" Text="Color Output" HorizontalAlignment="Center"/>
                    <Border BorderThickness="1" BorderBrush="Black" Margin="10 0 10 10" >
                        <Image Width="640" Height="480" Name="colorOutputImage" Margin="0" MouseMove="colorInputImage_MouseMove">
                            <Image.Effect>
                                <effects:DepthMerge x:Name="mergeEffect" NearDistance="{Binding Value, ElementName=lowerSlider}" FarDistance="{Binding Value, ElementName=upperSlider}"/>
                            </Image.Effect>
                        </Image>
                    </Border>
                </StackPanel>
            </StackPanel >
            <StackPanel Visibility="Visible" Name="Column3" Orientation="Vertical">
                <StackPanel Orientation="Vertical" ToolTip="Color frame with a partially transparent depth frame overlaid">
                    <TextBox FontSize="18" Focusable="False" BorderThickness="0" Text="Depth over Video" HorizontalAlignment="Center" Name="OverlayCaption" />
                    <Border BorderThickness="1" BorderBrush="Black" Margin="10 0 10 10" >
                        <Canvas Width="400" Height="300" >
                            <Image Width="400" Height="300" Name="depthVideoOverlayImage"  Margin="0" Opacity="1" Canvas.Left="0" Canvas.Top="0" />
                            <Image Width="400" Height="300" Name="depthVideoOverlayImage2" Margin="0" Opacity="0.7" Canvas.Left="0" Canvas.Top="0"/>
                        </Canvas>
                    </Border>
                </StackPanel>
                <StackPanel ToolTip="Depth frames with the pixel color pulled from the color frame">
                    <TextBox FontSize="18" Focusable="False" BorderThickness="0" Text="Depth Map with Colored Pixels" HorizontalAlignment="Center" Name="otherInputCaption" />
                    <Border  BorderThickness="1" BorderBrush="Black" Margin="10 0 10 10" >
                        <Image Width="400" Height="300" Name="otherInputImage" Margin="0"/>
                    </Border>
                </StackPanel>
            </StackPanel>
        </StackPanel>
    </StackPanel>
</Window>
